package com.sun.plugin.aspose.base;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import org.apache.commons.beanutils.PropertyUtils;

public class Teacher {
	private String id;
	private String name;
	private int age;
	private Source source;
	private List<Student> students = new ArrayList<>();
	
	public Teacher() {
		this.id = UUID.randomUUID().toString();
		this.name = "名称";
		this.age = 3;
		this.source = new Source(UUID.randomUUID().toString(), "SOURCE", "22");
		Student s1 = new Student(UUID.randomUUID().toString(), "S1");
		Student s2 = new Student(UUID.randomUUID().toString(), "S2");
		Student s3 = new Student(UUID.randomUUID().toString(), "S3");
		this.students.add(s1);
		this.students.add(s2);
		this.students.add(s3);
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public List<Student> getStudents() {
		return students;
	}

	public void setStudents(List<Student> students) {
		this.students = students;
	}

	public Source getSource() {
		return source;
	}

	public void setSource(Source source) {
		this.source = source;
	}
	public static void main(String[] args) throws Exception {
		Teacher t = new Teacher();
		Object o = PropertyUtils.getProperty(t, "students[0].id");
		System.out.println(o);
	}
}
